@import 'scss-imports/cssvars';
@import 'text-security/text-security.css';

:host {
  color: var(--fg1);
  display: block;
  margin-bottom: 12px;
  margin-top: 12px;
  padding: 8px 0;

  :host-context(ix-editable) & {
    margin-bottom: 0;
    margin-top: 0;
  }
}

.disabled {
  opacity: var(--disabled-opacity);

  input {
    cursor: not-allowed;
    opacity: 1;
  }
}

.input-container {
  background: var(--bg1);
  border: solid 1.5px var(--lines);
  border-radius: 2px;
  display: flex;
  flex-direction: row;
  font-size: 12px;
  position: relative;

  &:focus-within {
    border-color: var(--primary);
  }

  &.readonly {
    background: var(--bg2);

    input {
      cursor: copy;
    }
  }
}

.link {
  color: var(--primary);
  cursor: pointer;
  font-size: x-small;
}

.reset-input,
.prefix-icon {
  align-items: center;
  bottom: 0;
  cursor: pointer;
  display: flex;
  opacity: 0.5;
  padding: 5px;
  position: absolute;
  right: 0.3rem;
  top: 0;
  user-select: none;
}

.prefix-icon {
  cursor: default;
  left: 2px;
  right: auto;
}

.prefix-padding {
  padding-left: 28px;
}

.input-container .ix-icon {
  height: 14px;
  line-height: 1;
  max-height: 16px;
  max-width: 16px;
  width: 14px;
}

.input-container {
  .toggle_pw {
    @include variable(display, --toggle_pw_display_prop, 'inline');
    opacity: var(--disabled-opacity);
  }

  .toggle_pw ix-icon {
    height: 18px;
    position: relative;
    top: -2px;
    width: 18px;
  }
}

.input-container .mat-icon-button {
  height: 24px;
  line-height: 24px;
  opacity: 0.5;
  width: 24px;
}

.password-field {
  font-family: text-security-disc;
  font-size: 14px;
  /* Use -webkit-text-security if the browser supports it */
  -webkit-text-security: disc;
}

.mat-error,
.mat-mdc-form-field-error {
  display: block;
  font-size: 12px;
  margin-top: 3px;
}

.has-reset-input-icon {
  padding-right: 20px;
}

::ng-deep .mat-option-text {
  text-overflow: ellipsis;
  white-space: nowrap;
}
